from django.conf.urls.defaults import patterns, include, url
from django.contrib import admin
from django.contrib import databrowse
from django.views.generic import DetailView

from app.models import *
from app.views import CompanyListView

admin.autodiscover()

databrowse.site.register(Person)
databrowse.site.register(Address)
databrowse.site.register(Company)

urlpatterns = patterns('',
    # Examples:
    url(r'^$', 'potala.app.views.home', name='home'),
    url(r'^get_company_list$', CompanyListView.as_view()),               
    url(r'^company/(?P<pk>\d+)/$', DetailView.as_view(model=Company, 
                                                      context_object_name="company", 
                                                      template_name = "app/company_details.html")),

    # Uncomment the next line to enable the admin:
    url(r'^admin/', include(admin.site.urls)),
    (r'^paf/(.*)', databrowse.site.root),
)


